﻿<!DOCTYPE html>

<html>
<head>
    <title>@ViewBag.Title -- Windvoice Manage</title>
    <link rel="stylesheet" type="text/css" href="/Content/css/manage.css" />
    <script type="text/javascript" src="/Content/js/jquery.js"></script>
    <script type="text/javascript">
        (function ($) {
            $.fn.handledelete = function (deleteurl) {
                if (confirm('确认删除？')) {
                    $.post(deleteurl, { 'id': $(this).data('delete') }, function (msg) {
                        if (msg.result.toString().toLowerCase() == 'true') {
                            alert('删除成功！');
                            window.location.reload();
                        }
                        else
                            alert('删除失败:' + message);
                    }, 'json');
                }
            },
            $.fn.redraw = function (maxwidth,maxheight) {
                var image = new Image();
                image.src = $(this).attr('src');
                //var maxwidth = 130;
                //var maxheight = 130;
                var imagewidth = 0, imageheight = 0;
                var obj = $(this);

                $("<img/>").attr("src", obj.attr("src")).load(function () {
                    imagewidth = this.width;   // Note: $(this).width() will not
                    imageheight = this.height; // work for in memory images.

                    if (imagewidth > 0 && imageheight > 0) {
                        if (imagewidth / imageheight >= maxwidth / maxheight) {  //宽大于长
                            if (imagewidth > maxwidth) {
                                obj.width(maxwidth);
                                obj.height(parseInt((imageheight * maxwidth) / imagewidth));
                                obj.css({ 'margin-top': parseInt((maxheight - obj.height()) / 2) + 'px', 'margin-left': '0' });
                            }
                            else {
                                obj.width(imagewidth);
                                obj.height(imageheight);
                                obj.css({ 'margin-top': parseInt((maxheight - obj.height()) / 2) + 'px', 'margin-left': parseInt((maxwidth - obj.width()) / 2) + 'px' });
                            }
                        }
                        else {               //长大于宽
                            if (imageheight >= maxheight) {
                                obj.width(parseInt((imagewidth * maxheight) / imageheight));
                                obj.height(maxheight);
                                obj.css({ 'margin-left': parseInt((maxwidth - obj.width()) / 2) + 'px', 'margin-top': '0' });
                            }
                            else {
                                obj.width(imagewidth);
                                obj.height(imageheight);
                                obj.css({ 'margin-top': parseInt((maxheight - obj.height()) / 2) + 'px', 'margin-left': parseInt((maxwidth - obj.width()) / 2) + 'px' });
                            }
                        }
                    }
                });

            }
        })(jQuery);
    </script>
    @RenderSection("headSection",false)
</head>
<body>
    <div id="header">
        <h1>Minimalistic Design Template</h1>
    </div>
    <div id="content">	
        <div id="left">
	        <div class="box">
			    <dl>
                    <dt><a href="javascript:;">日志管理</a></dt>
                    <dd><a href="/manage/article/create">创建日志</a></dd>
                    <dd><a href="/manage/category">日志分类</a></dd>
                    <dd><a href="/manage/article">日志管理</a></dd>
                    <dd><a href="/manage/comment">评论管理</a></dd>
                </dl>
			    <dl>
                    <dt><a href="javascript:;">照片管理</a></dt>
                    <dd><a href="/manage/photo/upload">添加照片</a></dd>
                    <dd><a href="/manage/album">相册列表</a></dd>
                </dl>
			    <dl>
                    <dt><a href="javascript:;">链接管理</a></dt>
                    <dd><a href="/manage/link/candidate">待选链接</a></dd>
                    <dd><a href="/manage/link">有效链接</a></dd>
                </dl>
			    <dl>
                    <dt><a href="/manage/user">用户</a></dt>
                </dl>
			    <dl>
                    <dt><a href="/manage/friend">好友</a></dt>
                </dl>
			    <dl>
                    <dt><a href="/manage/voice">Voice</a></dt>
                </dl>
	        </div>
        </div>

        <div id="right">
            @RenderBody()
        </div>
        <div class="clear"></div>
    </div>

</body>
</html>
